//word = "a123bc34d8ef34"

//word = "a123bc34d8ef34"
//word = "zgw5f0k7rj4q4tsk4dos1u"
//word = "a123bc34d8ef34"
word = "a1b01c001d4"
function solution(word) {
    let Hash = {}
    let mid = ''
    let res = 0
    for (let value of word) {
        if (parseInt(value) || parseInt(value) === 0) {
            mid += value
        } else {
            mid += ' '
        }
    }
    console.log(mid);

    mid = mid.trim().split(' ')
    console.log(mid);

    mid.forEach((item) => {
        if (!Hash[Number(item)] && item !== '') {
            Hash[Number(item)] = 1
        }
    })
    console.log(Hash);

    for (let key in Hash) {
        res += Hash[key]
    }
    return res
}
console.log(solution(word));
